<?php

namespace App\ModelFilters;

use EloquentFilter\ModelFilter;

class Qh_NoticeFilter extends ModelFilter
{
    /**
    * Related Models that have ModelFilters as well as the method on the ModelFilter
    * As [relationMethod => [input_key1, input_key2]].
    *
    * @var array
    */
    public $relations = [];

    public function type($v) {
        return $this->whereIn('type', explode(',', $v));
    }

    public function province($v) {
        return $this->whereRaw('(province = ? OR province is null)', [$v]);
    }
}
